package com.clusterswisdom.horn.api.tmall.action.refund;

import com.alibaba.fastjson.JSONObject;
import com.clusterswisdom.horn.api.ioc.HornAction;
import com.clusterswisdom.horn.api.ioc.HornResponse;
import com.clusterswisdom.horn.api.ioc.api.ApiConfig;
import com.taobao.api.domain.Refund;

public class RefundCancelAction extends RefundGetAction implements HornAction {

	@Override
	public HornResponse execute(ApiConfig config, JSONObject param) throws Exception {
		HornResponse response = super.execute(config, param);
		Refund refund = (Refund)response.getData();
		if (refund.getStatus() != RefundStatus.WAIT_SELLER_AGREE.getValue()) {
			throw new Exception("不是取消退款");
		}
		
		return response;
	}
}
